<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>组件注册语法糖</title>
</head>
<body>
<div id="app">
    <my-component></my-component>
    <cpn></cpn>
    <cpn2></cpn2>
</div>

<script type="module">
    import {createApp, defineComponent} from "../../../../js/vue.esm-browser.js";

    let app = createApp({
        setup() {
            return {}
        },

        components:{
            cpn: defineComponent({
                template:
                    "<h2>Hello, World!</h2><h2>世界，你好！</h2>"
            }),

            cpn2:
                {
                    template:
                        "<h2>Hello, World!</h2><h2>世界，你好！</h2>"
                }

        }

    })

    // 定义组件
    let component = defineComponent(
        {
            template:
                "<h1>Hello, World!</h1><h1>世界，你好！</h1>"
        }
    );

    // 注册组件
    app.component("my-component", component)

    app.mount("#app")
</script>
</body>
</html>